home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer 7.46
/
pcgamercd
/
Data
/
items.pcg
/
scripts
/
DefineButton2_292
/
BUTTONCONDACTION on(release, keyPress Enter).as
< prev
next >
Wrap
Text File
|
2004-08-12
|
2KB
|
68 lines
on(release, keyPress "<Enter>"){
if(searchstr != "")
{
charCounter = 0;
recordsFound = true;
j = searchstr.length - 1;
arGamesDBMain = arGamesDBMaster;
arGamesDBIndex = arGamesIndexMaster;
tempsearchstr = searchstr.toUpperCase();
while(j >= charCounter)
{
arGamesDBTemp = new Array();
arGamesIndexTemp = new Array();
i = 0;
iSlice = 0;
k = arGamesDBMain.length - 1;
while(k >= i)
{
tempstr = arGamesDBMain[i].toUpperCase();
if(tempstr.charAt(charCounter) == tempsearchstr.charAt(charCounter))
{
arGamesDBTemp[iSlice] = arGamesDBMain[i];
arGamesIndexTemp[iSlice] = arGamesDBIndex[i];
iSlice += 1;
}
i += 1;
}
charCounter += 1;
if(arGamesDBTemp.length == 0)
{
recordsFound = false;
break;
}
arGamesDBMain = arGamesDBTemp;
arGamesDBIndex = arGamesIndexTemp;
}
if(recordsFound)
{
TheCurrentitem = 0;
TopItem = 1;
GameBox_y = 224;
arGamesDBSlice = arGamesDBTemp;
arGamesIndexSlice = arGamesIndexTemp;
var i = 1;
while(scrollMax >= i)
{
set("menugame" + i,arGamesDBSlice[i - 1]);
set("gamenumber" + i,i);
i += 1;
}
if(dbCount == currentGameCount)
{
setProperty("itemBar" + lastGameBox, _alpha, 10);
}
setProperty("itemBar1", _alpha, 20);
theCurrentGame = arGamesDBIndex[0];
numitems = arGamesDBSlice.length;
num_Games = numitems;
lastButton = 1;
topDB = 1;
dbCount = 1;
currentGameCount = 1;
lastGameBox = 1;
gotoAndPlay(13);
}
}
}